package com.tbit.uqbike.webmanager.dao.capital;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tbit.config.datasource.DataSource;
import com.tbit.uqbike.object.pojo.AdvanceDepositQuery;
import com.tbit.uqbike.object.pojo.GiftCardQuery;
import com.tbit.uqbike.object.pojo.UserCapitalChange;
import com.tbit.uqbike.object.pojo.vo.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Entity generator.domain.Usercapitalchange
 */
@DS(DataSource.CAPITAL)
public interface UserCapitalChangeDao extends BaseMapper<UserCapitalChange> {

    AdvanceDepositTotalIncomeVO getAdvanceDepositTotalIncome(AdvanceDepositQuery query);

    List<AdvanceDepositVO> getAdvanceDepositList(AdvanceDepositQuery query);

    GiftCardTotalIncomeVO geGiftCardTotalIncome(GiftCardQuery query);

    List<GiftCardIncomeVO> getGiftCardList(GiftCardQuery query);

    /**
     * 查询流水记录详情
     *
     * @param brandId
     * @param accountIdList
     * @param startTime
     * @param endTime
     * @param phone
     * @param changeType
     * @param capitalType
     * @param businessType
     * @return
     */
    List<UserFundsFlowVO> selectUserFundsFlow(@Param("brandId") Integer brandId, @Param("accountIdList") List<Integer> accountIdList, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("phone") String phone, @Param("changeType") Integer changeType, @Param("capitalType") Integer capitalType, @Param("businessType") Integer businessType);

    /**
     * 查询流水记录条数
     */
    Integer selectUserFundsFlowCount(@Param("brandId") Integer brandId, @Param("accountIdList") List<Integer> accountIdList, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("phone") String phone, @Param("changeType") Integer changeType, @Param("capitalType") Integer capitalType, @Param("businessType") Integer businessType);

    /**
     * 流水记录统计
     *
     * @param brandId
     * @param accountIdList
     * @param startTime
     * @param endTime
     * @param phone
     * @param changeType
     * @param capitalType
     * @param businessType
     * @return
     */
    UserFundsFlowSumVO selectUserFundsFlowSum(@Param("brandId") Integer brandId, @Param("accountIdList") List<Integer> accountIdList, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("phone") String phone, @Param("changeType") Integer changeType, @Param("capitalType") Integer capitalType, @Param("businessType") Integer businessType);

    /**
     * 获取无人工预存款统计
     *
     * @param accountIds
     * @param startTime
     * @param endTime
     * @param brandId
     * @return
     */
    AdvanceDepositTotalIncomeVO getNoManualTotalAdvanceDeposit(List<Integer> accountIds, Long startTime, Long endTime, Integer brandId);

    /**
     * 获取无人工预存款列表
     *
     * @param accountIds
     * @param startTime
     * @param endTime
     * @param brandId
     * @return
     */
    List<AdvanceDepositVO> getNoManualAdvanceDepositList(List<Integer> accountIds, Long startTime, Long endTime, Integer brandId);
}




